package com.gzj.environment.model.system.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @description:
 * @author: tsing
 * @create: 2021-01-22 21:21
 */
@Data
public class UserSaveDto {

    private Long id;

    @NotBlank(message = "用户名不能为空")
    @Length(min = 4, max = 20)
    private String username;

    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))", message = "手机号码格式不正确")
    private String mobile;

}
